package com.example.first_android_project;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Act2 extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_act2);
		Button finok=(Button) findViewById(R.id.buttonokact2);
		finok.setOnClickListener(btnclick);
		Button fincancel=(Button) findViewById(R.id.buttoncancelact2);
		fincancel.setOnClickListener(btnclick);
	}
	private OnClickListener btnclick = new OnClickListener() {
		public void onClick(View v) {
			switch (v.getId()) {
			case R.id.buttonokact2:
				setResult (Activity.RESULT_OK);
				finish();
				break;
			case R.id.buttoncancelact2:
				setResult (Activity.RESULT_CANCELED);
				finish();
				break;
			}
		}
	};
}
